//
//  BaseViewController.m
//  E--cancel
//
//  Created by yuyi_liu on 2017/8/7.
//  Copyright © 2017年 yuyigufen. All rights reserved.
//

#import "BaseViewController.h"
#import "ViewController.h"
@interface BaseViewController ()

@end

@implementation BaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupSubViews];
    // Do any additional setup after loading the view.
}
-(void)setupSubViews{
    NSArray *arrayVC =@[
                        @{
                            @"class":[ViewController class],
                            @"title":@"首页",
                            @"icon":@"",
                            @"icons":@"",
                            },
                        @{
                            @"class":[ViewController class],
                            @"title":@"资讯",
                            @"icon":@"",
                            @"icons":@"",
                            },
                        @{
                            @"class":[ViewController class],
                            @"title":@"发布",
                            @"icon":@"",
                            @"icons":@"",
                            },
                        @{
                            @"class":[ViewController class],
                            @"title":@"帮帮",
                            @"icon":@"",
                            @"icons":@"",
                            },
                        @{
                            @"class":[ViewController class],
                            @"title":@"我的",
                            @"icon":@"",
                            @"icons":@"",
                            },
                        ];
    
    NSMutableArray *viewControllers =[NSMutableArray arrayWithCapacity:arrayVC.count];
    [arrayVC enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        UIViewController *viewController = [[[obj objectForKey:@"class"] alloc] init];
        
        viewController.title = [obj objectForKey:@"title"];
//        viewController.tabBarItem =[[UITabBarItem alloc]initWithTitle:[obj objectForKey:@"title"] image:[UIImage imageNamed:[obj objectForKey:@"icon"]] selectedImage:[UIImage imageNamed:[obj objectForKey:@"icons"]]];
        UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:viewController];
        [viewControllers addObject:nav];
        
        
    }];
    self.viewControllers = viewControllers;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
